---
title: Remove Page Annotation
description: Learn how to delete an existing annotation from a PDF page.
searchable: true
---

# removePageAnnotation

Deletes an existing annotation from a specified page.

## Signature

```typescript
removePageAnnotation(
  doc: PdfDocumentObject,
  page: PdfPageObject,
  annotation: PdfAnnotationObject
): PdfTask<boolean>;
````

## Description

This method finds and permanently removes an annotation from the PDF document in memory. The annotation is identified by its **`id`** property.

To persist this change, you must call `saveAsCopy` to generate a new PDF file without the deleted annotation.

## Parameters

| Name | Type | Description |
| :--- | :--- | :--- |
| **`doc`** | `PdfDocumentObject` | The handle of the document to modify. |
| **`page`** | `PdfPageObject` | The page where the annotation exists. |
| **`annotation`** | `PdfAnnotationObject` | The annotation object to remove. Only the `id` property is used for identification. |

## Returns

`PdfTask<boolean>`

A **`Task`** that resolves with `true` if the annotation was successfully found and removed.

## Example

```typescript
// Assuming 'engine', 'document', and 'page' are available

async function deleteAnnotation(annotationToDelete) {
  try {
    const success = await engine.removePageAnnotation(document, page, annotationToDelete).toPromise();
    if (success) {
      console.log(`Annotation ${annotationToDelete.id} was successfully removed.`);
      // Re-render the page to reflect the change
    }
  } catch (error) {
    console.error('Failed to remove annotation:', error);
  }
}
```

## See Also

  - [Get Page Annotations](./get-page-annotations.md)
  - [Create Page Annotations](./create-page-annotation.md)
  - [Update Page Annotations](./update-page-annotation.md)